package com.frx.leetoffer;

import java.util.Arrays;

/**
 * Created with IDEA
 *
 * @author: xrf
 * @Date: 2019/11/4
 * @Time: 16:06
 */
public class DpFish {
    static int[][] dp = new int[21][31];
    public static void main(String[] args){
        System.out.println(solution(10,30));
        for (int i=0;i<dp.length;i++){
            System.out.println(Arrays.toString(dp[i]));
        }
    }

    public static int solution(int bucketN,int fishN){
        if (bucketN<=0 || fishN <0){
            return 0;
        }
        if (bucketN == 1 && fishN <= 10){
            return 1;
        }
        if (dp[bucketN][fishN] == 0){
            for (int i=0;i<=10;i++){
                dp[bucketN][fishN] += solution(bucketN-1,fishN-i);
            }
        }


        return dp[bucketN][fishN];
    }

}
